package com.efuture.vdrp.android.servlet;

import java.io.IOException;
import java.util.ArrayList;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class TimeSearch extends HttpServlet {
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		response.setContentType("text/html");
		request.setCharacterEncoding("gbk");
		response.setCharacterEncoding("gbk");
		java.io.ObjectOutputStream op = new java.io.ObjectOutputStream(response
				.getOutputStream());
		java.io.ObjectInputStream oi = new java.io.ObjectInputStream(request
				.getInputStream());
		MySQL my = new MySQL();
		String str;
		ArrayList list = new ArrayList();
		try {
			str = (String) oi.readObject();
			String[] s = str.split(",");
			String time = s[0];
			String time1 = s[1];
			list = my.searchtime(time, time1);
			op.writeObject(list);
			op.flush();
			op.close();

		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}

	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		doGet(request, response);
	}

}
